#pragma once
#ifndef QBE_INPUT_KEYBOPARDSHORTCUTS_HPP
#define QBE_INPUT_KEYBOPARDSHORTCUTS_HPP

#include <vsg/all.h>

namespace qbe::input {

// 快捷键
struct KeyBoardShortcuts {
  vsg::KeySymbol keyBase = vsg::KEY_Undefined;     // 按键 (字母不区分大小写)
  vsg::KeyModifier keyModifier = vsg::MODKEY_OFF;  // 修饰符

  bool operator==(const KeyBoardShortcuts& self) const { return (self.keyBase == keyBase) && (self.keyModifier == keyModifier); }
  struct Hash {
    std::size_t operator()(const KeyBoardShortcuts& self) const;
  };
};

// 快捷键管理器-[资源]
struct KeyBoardShortcutsManager {

  // 增删改快捷键 (返回是否成功)
  bool add(KeyBoardShortcuts keyBoard, std::string name);
  bool change(KeyBoardShortcuts keyBoard, std::string name);
  bool remove(KeyBoardShortcuts keyBoard);

  // 获取map：快捷键-功能内容
  const std::unordered_map<KeyBoardShortcuts, std::string, KeyBoardShortcuts::Hash> getMap() const;

 private:
  std::unordered_map<KeyBoardShortcuts, std::string, KeyBoardShortcuts::Hash> key_map;
};

}  // namespace qbe::input

#endif